<extend name="./Application/Common/View/block/base.php" />
<block name="header">
    <include file="./Application/Admin/View/block/easyui_header.php" />
    <link rel="stylesheet" type="text/css" href="/Public/uploadfy/uploadify.css" />
    <link href="__PUBLIC__/css/table_css.css" rel="stylesheet" type="text/css" />
</block>
<block name="bdoy">
    <body>
    <form action="" method="post" onsubmit="return $(this).form('validate');">
        <input type="hidden" name="id" value="{$obj['id']}"/>
        <input type="hidden" name="nav" value="{$obj['type']}"/>
        <table cellspacing="0" width="100%" class="">
            <tr>
                <td class="label"><strong>{:LANG('title')}: </strong></td>
                <td class="form-line">
                    <input value="{$obj['title']}" class="easyui-textbox easyui-validatebox input-text" name="title" id="title" size="50" style="height: 24px;line-height: 24px;"
                           data-options="prompt:'{:LANG('please_input')}{:LANG('title')}',required:true,validType:'length[2,50]'">
                </td>

            </tr>
            <tr>
                <td class="label"><strong>{:LANG('writer')}: </strong></td>
                <td class="form-line">
                    <input value="{$obj['writer']}" class="easyui-textbox easyui-validatebox input-text" name="writer" id="writer" size="50" style="height: 24px;line-height: 24px;"
                           data-options="prompt:'{:LANG('please_input')}{:LANG('writer')}',required:true,validType:'length[2,50]'">
                </td>
            </tr>
            <tr>
                <td class="label"><strong>{:LANG('from')}: </strong></td>
                <td class="form-line">
                    <input value="{$obj['from']}" class="easyui-textbox easyui-validatebox input-text" name="from" id="from" size="50" style="height: 24px;line-height: 24px;"
                           data-options="prompt:'{:LANG('please_input')}{:LANG('from')}',required:true,validType:'length[2,50]'">
                </td>
            </tr>
            <tr>
                <td class="label"><strong>{:LANG('sort')}: </strong></td>
                <td class="form-line">
                    <input value="{$obj['sort']}" class="easyui-textbox easyui-validatebox input-text" name="sort" id="sort" size="10" style="height: 24px;line-height: 24px;"
                           data-options="prompt:'{:LANG('please_input')}{:LANG('sort')}:{:LANG('bigger_to_front')}',required:true,validType:'length[1,11]'">
                </td>
            </tr>
            <tr>
                <td class="label"><strong>{:LANG('status')}: </strong></td>
                <td class="form-line radio-line">
                    <label>{:LANG('pass')}</label><input id="yes" class="radio" type="radio" name="status" value="1">
                    &nbsp;&nbsp;&nbsp;
                    <label>{:LANG('no_pass')}</label><input id="no" class="radio" type="radio" name="status" value="0">
                </td>
            </tr>
            <tr>
                <td class="label"><strong>{:LANG('main_img')}: </strong></td>
                <td class="form-line">
                    <img class="main_img" src="{:filter_path($obj['post'])}" height="200"/>
                    <input value="{$obj['post']}" class="easyui-validatebox" data-options="required:true,validType:'length[1,255]'"
                           type="hidden" name="post" id="post">
                    <input id="file_upload_main" name="file_upload" type="file" multiple="true" value="" />
                </td>
            </tr>
            <tr>
                <td class="label"></td>
                <td class="form-line">
                    <input type="submit" class="submit-button bule-button" value="{:LANG('save')}">
                    <input type="button" onclick="close_dialog()" class="submit-button" value="{:LANG('cancel')}">
                </td>
            </tr>
        </table>
    </form>
    </body>
</block>
<block name="footExtendJs">
    <script>
        var is_pass = {$obj['status']};
        if(is_pass == 1){
            $('#yes').attr('checked', 'checked');
        }else{
            $('#no').attr('checked', 'checked');
        }
    </script>
    <!--上传图片-->
    <script type="text/javascript" src="/Public/uploadfy/jquery.uploadify.min.js"></script>
    <script type="text/javascript">
        $(function() {
            $('#file_upload_main').uploadify({
                'swf'      : '/Public/uploadfy/uploadify.swf',
                'uploader' : '/Album/AdminAlbumImg/uploadify',
                'buttonText' : '上传图片',
                'onUploadSuccess' : function(file, data, response) {
                    var imgname = data.trim();
                    $('.main_img').attr('src', imgname);
                    $('#post').val(imgname);
                }
            });

        });
    </script>

</block>
